package asteroids.statement;

import asteroids.expression.*;
import asteroids.*;
import asteroids.model.programs.*;


public class Print extends Statement {
	private Expression exp;
	private Statement.StatementType type;

	public Print(Expression e) {
		this.type = StatementType.PRINT;
		this.exp = e;
	}

	@Override
	public void execute(Program program) {
		if (exp == null) {
			System.out.println("");
		} else {
			System.out.println(""+ exp.toString(program));
		}
		this.finished = true;

	}

	@Override
	public int getSize() {
		return 1;
	}

}
